<template>
  <!--行业动态-->
  <div>
    <carousel :autoplaySpeed="autoplaySpeed" :Img="Img"></carousel>
    <v_menu :title="data.title" :site="data.list[activeIndex].list"></v_menu>

    <Row :gutter="16" class="wrapper">
      <i-col span="19" class="content">
        <div>
          <news :data="work" :activeIndex="activeIndex"></news>
        </div>
      </i-col>
      <i-col span="5" class="navigation">
        <ngn :data="data" :activeIndex="activeIndex"></ngn>
      </i-col>
    </Row>
    <!--Vue组件-->
    <div class="page">
      <paging :all="all" @returnValue="returnValue"></paging>
    </div>
  </div>
</template>

<script>
  import carousel from '../module/carousel'
  import ngn from '../module/ngn'
  import news from '../module/news'
  import paging from '../module/paging'
  import v_menu from '../module/menu'

  export default {
    components: {carousel, ngn, news, paging, v_menu},
    data() {
      return {
        activeIndex: 2,
        autoplaySpeed: 100000,
        industryDynamicLink: this.$api.url + '/news/list/all/dynamic/',
        all: 1,
        cur: 1,
        Img: [
          {
            id: 1,
            imageLocation: require('../../assets/img/u69.jpg'),
            state: true,
            uri: "",
          },
        ],
        data: {
          title: '资讯中心',
          list: [
            {list: '期刊资讯', link: 'JournalofInformation',},
            {list: '工作动态', link: 'workTrend',},
            {list: '行业动态', link: 'industryDynamic'},
            {list: '公告通知', link: 'announcementNotice'},
            {list: '投稿攻略', link: 'SubmissionStrategy'},
          ],
        },
        work: []
      }
    },
    mounted() {
      this.dataArray()
    },
    methods: {
      returnValue(data) {
        this.cur = data;
        this.dataArray()
      },
      dataArray() {
        this.$axios.get(this.industryDynamicLink + this.cur).then((res) => {
          this.work = res.data.data.lists;
          this.all = res.data.data.totalPage
        });
      },
    },
  }
</script>

<style scoped>
  /*主要内容*/
  .wrapper .content {
    border-right: 1px solid #ccc;
    min-height: 300px;
  }

  .wrapper .navigation {
    padding-left: 0 !important;
  }
</style>

